package com.code2roc.jarmanage.db;

import com.code2roc.jarmanage.model.ProjectDO;
import com.code2roc.jarmanage.model.ProxyDO;
import com.code2roc.jarmanage.util.CommonUtil;
import com.code2roc.jarmanage.util.DataBaseUtil;

import java.util.List;

public class ProxyDB {
    public static void insert(ProxyDO entity) {
        entity.setProxyID(CommonUtil.getNewGuid());
        DataBaseUtil.insert("DepolyProxy", entity);
    }

    public static void delete(String proxyID) {
        DataBaseUtil.executeSQL("delete from DepolyProxy where proxyID='" + proxyID + "'");
    }

    public static void update(ProxyDO entity) {
        DataBaseUtil.update("DepolyProxy", entity, "proxyID");
    }

    public static ProxyDO selectOne(String proxyID) {
        return DataBaseUtil.selectOne(ProxyDO.class, "DepolyProxy", "proxyID", proxyID);
    }

    public static List<ProxyDO> selectList(String where) {
        return DataBaseUtil.selectList(ProxyDO.class, "DepolyProxy", where);
    }
}
